class FirstClass:
    name = "wsl"  # 类属性
    age = 18
    __add = 0  # private 该类
    _phone = 0  # protected 该类及子类

    # 构造函数
    def __init__(self, name, age):
        # 实例变量
        self.name = name
        self.age = age
        self.__add += 1
        print(self.__add)

    # 实例方法
    def show(self):
        print("实例方法...{name},{age}".format(name=self.name, age=self.age))

    @classmethod
    def info(cls):
        print("实例方法...")

    @staticmethod
    def say():
        print("静态方法...")


f1 = FirstClass('wsl222', 18)
f1.show()
print(f1.name, f1.age)

# 修改实例变量的值
f1.name = 'wsl333'
f1.age = 38
print(f1.name, f1.age)
print(FirstClass.name, FirstClass.age)

# 修改类变量的值
FirstClass.name = 'mlf'
FirstClass.age = '0'
print(FirstClass.name, FirstClass.age)

# 添加变量
f1.app = '微信'
print(f1.app)

# 删除变量
del f1.app

FirstClass.info()
FirstClass.say()
f1.say()
f1.info()

boo = hasattr(f1, 'app')
print(boo)
print(getattr(f1, 'name'))
setattr('app', 'qq')
delattr(f1, 'app')
